diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 152d4d2..9b30ad2 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -35,15 +35,13 @@
 	sparc*)
 		debarch=sparc ;;
 	s390*)
-		debarch=s390$(grep -q CONFIG_64BIT=y $KCONFIG_CONFIG && echo x || true) ;;
+		debarch=s390 ;;
 	ppc*)
-		debarch=$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo ppc64el || echo powerpc) ;;
+		debarch=powerpc ;;
 	parisc*)
 		debarch=hppa ;;
 	mips*)
 		debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
-	arm64)
-		debarch=arm64 ;;
 	arm*)
 		debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el || true) ;;
 	*)
@@ -64,42 +62,26 @@
 	fi
 
 	# Create the package
-	dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir"
+	dpkg-gencontrol -isp $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir"
 	dpkg --build "$pdir" ..
 }
 
 # Some variables and settings used throughout the script
+version=$KERNELRELEASE
 revision=$(cat .version)
-
-#e.g. 3.14.28-xxxx for version and package name
-if grep -q '^CONFIG_LOCALVERSION_AUTO=y' $KCONFIG_CONFIG 
-then
-  version=`echo $KERNELRELEASE | cut -f -2 -d- `
-else
-  version=$KERNELRELEASE
-fi
-
-#e.g take commit sha for package version
 if [ -n "$KDEB_PKGVERSION" ]; then
 	packageversion=$KDEB_PKGVERSION
-elif grep -q '^CONFIG_LOCALVERSION_AUTO=y' $KCONFIG_CONFIG
-then
-  packageversion=`echo $KERNELRELEASE | cut -f -2 -d- --complement`
 else
-  packageversion=$version-$revision
+	packageversion=$version-$revision
 fi
-
 tmpdir="$objtree/debian/tmp"
 fwdir="$objtree/debian/fwtmp"
 kernel_headers_dir="$objtree/debian/hdrtmp"
 libc_headers_dir="$objtree/debian/headertmp"
-dtb_dir="$objtree/debian/tmp"
 dbg_dir="$objtree/debian/dbgtmp"
-metadir="$objtree/debian/metatmp"
 packagename=linux-image-$version
 fwpackagename=linux-firmware-image-$version
 kernel_headers_packagename=linux-headers-$version
-dtb_packagename=linux-dtb-$version
 libc_headers_packagename=linux-libc-dev
 dbg_packagename=$packagename-dbg
 
@@ -118,32 +100,24 @@
 	installed_image_path="boot/vmlinux-$version"
 	;;
 *)
-	installed_image_path="boot/"
+	installed_image_path="boot/vmlinuz-$version"
 esac
 
 BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $KCONFIG_CONFIG || true)"
 
 # Setup the directory structure
-rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir" \
-   "$dbg_dir" "$dtb_dir" "$metadir"  2>/dev/null
+rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir"
 mkdir -m 755 -p "$tmpdir/DEBIAN"
 mkdir -p  "$tmpdir/lib" "$tmpdir/boot" "$tmpdir/usr/share/doc/$packagename"
 mkdir -m 755 -p "$fwdir/DEBIAN"
-mkdir -p "$fwdir/lib/firmware/$KERNELRELEASE/" "$fwdir/usr/share/doc/$fwpackagename"
+mkdir -p "$fwdir/lib/firmware/$version/" "$fwdir/usr/share/doc/$fwpackagename"
 mkdir -m 755 -p "$libc_headers_dir/DEBIAN"
 mkdir -p "$libc_headers_dir/usr/share/doc/$libc_headers_packagename"
-
-mkdir -m 755 -p "$dtb_dir/DEBIAN"
-mkdir -p "$dtb_dir/boot/dts" "$dtb_dir/usr/share/doc/$dtb_packagename"
-
-mkdir -m 755 -p "$metadir/DEBIAN"
-mkdir -p  "$metadir/usr/share/doc/linux-$version"
-
 mkdir -m 755 -p "$kernel_headers_dir/DEBIAN"
 mkdir -p "$kernel_headers_dir/usr/share/doc/$kernel_headers_packagename"
-mkdir -p "$kernel_headers_dir/lib/modules/$KERNELRELEASE/"
+mkdir -p "$kernel_headers_dir/lib/modules/$version/"
 if [ "$ARCH" = "um" ] ; then
-	mkdir -p "$tmpdir/usr/lib/uml/modules/$KERNELRELEASE" "$tmpdir/usr/bin"
+	mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/bin"
 fi
 if [ -n "$BUILD_DEBUG" ] ; then
 	mkdir -p "$dbg_dir/usr/share/doc/$dbg_packagename"
@@ -153,12 +127,12 @@
 # Build and install the kernel
 if [ "$ARCH" = "um" ] ; then
 	$MAKE linux
-	cp System.map "$tmpdir/usr/lib/uml/modules/$KERNELRELEASE/System.map"
+	cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map"
 	cp $KCONFIG_CONFIG "$tmpdir/usr/share/doc/$packagename/config"
 	gzip "$tmpdir/usr/share/doc/$packagename/config"
-else
-	cp System.map "$tmpdir/boot/System.map-$KERNELRELEASE"
-	cp $KCONFIG_CONFIG "$tmpdir/boot/config-$KERNELRELEASE"
+else 
+	cp System.map "$tmpdir/boot/System.map-$version"
+	cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version"
 fi
 # Not all arches include the boot path in KBUILD_IMAGE
 if [ -e $KBUILD_IMAGE ]; then
@@ -169,41 +143,33 @@
 
 if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
 	INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_install
-	rm -f "$tmpdir/lib/modules/$KERNELRELEASE/build"
-	rm -f "$tmpdir/lib/modules/$KERNELRELEASE/source"
+	rm -f "$tmpdir/lib/modules/$version/build"
+	rm -f "$tmpdir/lib/modules/$version/source"
 	if [ "$ARCH" = "um" ] ; then
-		mv "$tmpdir/lib/modules/$KERNELRELEASE"/* "$tmpdir/usr/lib/uml/modules/$KERNELRELEASE/"
-		rmdir "$tmpdir/lib/modules/$KERNELRELEASE"
+		mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/"
+		rmdir "$tmpdir/lib/modules/$version"
 	fi
 	if [ -n "$BUILD_DEBUG" ] ; then
-		for module in $(find $tmpdir/lib/modules/ -name *.ko -printf '%P\n'); do
-			module=lib/modules/$module
-			mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
-			# only keep debug symbols in the debug file
-			$OBJCOPY --only-keep-debug $tmpdir/$module $dbg_dir/usr/lib/debug/$module
-			# strip original module from debug symbols
-			$OBJCOPY --strip-debug $tmpdir/$module
-			# then add a link to those
-			$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $tmpdir/$module
-		done
+		(
+			cd $tmpdir
+			for module in $(find lib/modules/ -name *.ko); do
+				mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
+				# only keep debug symbols in the debug file
+				$OBJCOPY --only-keep-debug $module $dbg_dir/usr/lib/debug/$module
+				# strip original module from debug symbols
+				$OBJCOPY --strip-debug $module
+				# then add a link to those
+				$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
+			done
+		)
 	fi
 fi
 
-if grep -q '^CONFIG_OF=y' $KCONFIG_CONFIG ; then
-	mkdir -p "$tmpdir/boot/dts"
-	cp $objtree/arch/arm/boot/dts/*.dtb $dtb_dir/boot/dts
-	#INSTALL_DTBS_PATH="$dtb_dir/boot/dts" $MAKE KBUILD_SRC= dtbs_install
-fi
-
 if [ "$ARCH" != "um" ]; then
 	$MAKE headers_check KBUILD_SRC=
 	$MAKE headers_install KBUILD_SRC= INSTALL_HDR_PATH="$libc_headers_dir/usr"
 fi
 
-# Firmware
-$MAKE firmware_install KBUILD_SRC= INSTALL_FW_PATH="$tmpdir/lib/firmware"
-
-
 # Install the maintainer scripts
 # Note: hook scripts under /etc/kernel are also executed by official Debian
 # kernel packages, as well as kernel packages built using make-kpkg.
@@ -217,33 +183,18 @@
 fi
 for script in postinst postrm preinst prerm ; do
 	mkdir -p "$tmpdir$debhookdir/$script.d"
-
-	unset metascript
-	[ $script = "preinst" ] && metascript="
-rm -rf /boot/dts
-rm -rf /boot/zImage
-rm -rf /boot/System.map*
-rm -rf /boot/config*
-
-"
-
 	cat <<EOF > "$tmpdir/DEBIAN/$script"
 #!/bin/sh
 
 set -e
 
-$metascript
-
 # Pass maintainer script parameters to hook scripts
-
 export DEB_MAINT_PARAMS="\$*"
 
 # Tell initramfs builder whether it's wanted
-
 export INITRD=$want_initrd
 
-#ubuntu dont evaluate INITRD variable. why?
-#test -d $debhookdir/$script.d && run-parts --arg="$KERNELRELEASE" --arg="/$installed_image_path" $debhookdir/$script.d
+test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d
 exit 0
 EOF
 	chmod 755 "$tmpdir/DEBIAN/$script"
@@ -270,7 +221,7 @@
 cat <<EOF > debian/changelog
 linux-upstream ($packageversion) unstable; urgency=low
 
-  * Custom built Linux kernel for UDOO.
+  * Custom built Linux kernel.
 
  -- $maintainer  $(date -R)
 EOF
@@ -303,7 +254,6 @@
 Maintainer: $maintainer
 Standards-Version: 3.8.4
 Homepage: http://www.kernel.org/
-Vcs-Browser: https://github.com/UDOOboard/linux_kernel
 EOF
 
 if [ "$ARCH" = "um" ]; then
@@ -327,43 +277,29 @@
 	cat <<EOF >> debian/control
 
 Package: $packagename
-Provides: linux-image, linux-image-2.6, linux-modules-$version, $dtb_packagename
+Provides: linux-image, linux-image-2.6, linux-modules-$version
 Suggests: $fwpackagename
-Replaces: linux-image, linux-image-2.6, linux-modules-$version, $dtb_packagename
-Conflicts: linux-image, linux-image-2.6, linux-modules-$version, $dtb_packagename
 Architecture: any
 Description: Linux kernel, version $version
- This package contains the Linux kernel, modules, device tree blobs
- and corresponding other files, version: $version.
-
-Package: linux-$version
-Depends: $dtb_packagename, $packagename, $fwpackagename 
-Architecture: any
-Description: Linux kernel, version $version
- This metapackage contains the Linux kernel, modules, device tree blobs
- and corresponding other files, version: $version.
-
+ This package contains the Linux kernel, modules and corresponding other
+ files, version: $version.
 EOF
 
 fi
 
-# Build kernel header package
-if [ -n "$BUILD_HEADERS" ] ; then
-  
-  (cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl) > "$objtree/debian/hdrsrcfiles"
-  (cd $srctree; find arch/$SRCARCH/include include scripts -type f) >> "$objtree/debian/hdrsrcfiles"
-  (cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> "$objtree/debian/hdrsrcfiles"
-  (cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> "$objtree/debian/hdrsrcfiles"
-  (cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles"
-  destdir=$kernel_headers_dir/usr/src/linux-headers-$version
-  mkdir -p "$destdir"
-  (cd $srctree; tar -c -f - -T -) < "$objtree/debian/hdrsrcfiles" | (cd $destdir; tar -xf -)
-  (cd $objtree; tar -c -f - -T -) < "$objtree/debian/hdrobjfiles" | (cd $destdir; tar -xf -)
-  (cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be
-  ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$KERNELRELEASE/build"
-  rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
+# Build header package
+(cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles")
+(cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles")
+(cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles")
+destdir=$kernel_headers_dir/usr/src/linux-headers-$version
+mkdir -p "$destdir"
+(cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -)
+(cd $objtree; tar -c -f - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -)
+(cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be
+ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build"
+rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
 
-  cat <<EOF >> debian/control
+cat <<EOF >> debian/control
 
 Package: $kernel_headers_packagename
 Provides: linux-headers, linux-headers-2.6
@@ -374,35 +310,15 @@
  This is useful for people who need to build external modules
 EOF
 
-  cat <<EOF >> debian/control
-
-Package: $libc_headers_packagename
-Section: devel
-Provides: linux-kernel-headers
-Architecture: any
-Description: Linux support headers for userspace development
- This package provides userspaces headers from the Linux kernel.  These headers
- are used by the installed headers for GNU glibc and other system libraries.
-EOF
-
-  if [ "$ARCH" != "um" ]; then
-  	create_package "$kernel_headers_packagename" "$kernel_headers_dir"
-  	create_package "$libc_headers_packagename" "$libc_headers_dir"
-  fi
-fi
-
 # Do we have firmware? Move it out of the way and build it into a package.
 if [ -e "$tmpdir/lib/firmware" ]; then
-	mv "$tmpdir/lib/firmware"/* "$fwdir/lib/firmware/$KERNELRELEASE/"
+	mv "$tmpdir/lib/firmware"/* "$fwdir/lib/firmware/$version/"
 	rmdir "$tmpdir/lib/firmware"
 
 	cat <<EOF >> debian/control
 
 Package: $fwpackagename
 Architecture: all
-Provides: linux-firmware
-Conflicts: linux-firmware
-Replaces: linux-firmware
 Description: Linux kernel firmware, version $version
  This package contains firmware from the Linux kernel, version $version.
 EOF
@@ -410,20 +326,35 @@
 	create_package "$fwpackagename" "$fwdir"
 fi
 
+cat <<EOF >> debian/control
+
+Package: $libc_headers_packagename
+Section: devel
+Provides: linux-kernel-headers
+Architecture: any
+Description: Linux support headers for userspace development
+ This package provides userspaces headers from the Linux kernel.  These headers
+ are used by the installed headers for GNU glibc and other system libraries.
+EOF
+
+if [ "$ARCH" != "um" ]; then
+	create_package "$kernel_headers_packagename" "$kernel_headers_dir"
+	create_package "$libc_headers_packagename" "$libc_headers_dir"
+fi
+
 create_package "$packagename" "$tmpdir"
-create_package "linux-$version" "$metadir"
 
 if [ -n "$BUILD_DEBUG" ] ; then
 	# Build debug package
 	# Different tools want the image in different locations
 	# perf
-	mkdir -p $dbg_dir/usr/lib/debug/lib/modules/$KERNELRELEASE/
-	cp vmlinux $dbg_dir/usr/lib/debug/lib/modules/$KERNELRELEASE/
+	mkdir -p $dbg_dir/usr/lib/debug/lib/modules/$version/
+	cp vmlinux $dbg_dir/usr/lib/debug/lib/modules/$version/
 	# systemtap
 	mkdir -p $dbg_dir/usr/lib/debug/boot/
-	ln -s ../lib/modules/$KERNELRELEASE/vmlinux $dbg_dir/usr/lib/debug/boot/vmlinux-$version
+	ln -s ../lib/modules/$version/vmlinux $dbg_dir/usr/lib/debug/boot/vmlinux-$version
 	# kdump-tools
-	ln -s lib/modules/$KERNELRELEASE/vmlinux $dbg_dir/usr/lib/debug/vmlinux-$version
+	ln -s lib/modules/$version/vmlinux $dbg_dir/usr/lib/debug/vmlinux-$version
 
 	cat <<EOF >> debian/control
 
